// compentents/information/information.js
const request = require("../../utils/request")
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    InformationData:{
      type:Array
    },
    isLoading:{
      type:Boolean
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },
lifetimes:{
  attached(){
    // console.log(this.data);
  }
},
  /**
   * 组件的方法列表
   */
  methods: {
// 跳转到咨询详情
async go2InfoDetail(e){
  const {_id}=e.currentTarget.dataset.info
  const data = e.currentTarget.dataset.info
  delete data._id
  data.count=(data.count*1)+1
  console.log(data.count);
  const res =await request({
    url:"information/change",
    method:"post",
    data:{
      _id,
      ...data
    }
  })
  wx.navigateTo({
    url: `/pages/informationdetail/informationdetail?data=${e.currentTarget.dataset.text}`,
  })
}
  }
})
